#ifndef _SYS_DURATION_H_
#define _SYS_DURATION_H_

#include "FanObj.h"
#include "SysTypes.h"

#define DURATION_VTABLE(self)   ((DurationVTable*)((FanObj*)self)->vtable)


extern Type*    Duration_classType;
extern VTable*  Duration_classVTable;


/* [sys::Duration] Attributes */
struct Duration
{
  FanObj        super;
};


/* [sys::Duration] Virtual-table */
typedef struct DurationVTable
{
  FanObjVTable  super;
} DurationVTable;


/* [sys::Duration] Methods and fields */
Bool            Duration_equals(Obj self, NullableObj obj);
Int             Duration_compare(Obj self, Obj obj);
Int             Duration_hash(Obj self);
Str*            Duration_toStr(Obj self);
Duration*       Duration_defVal(void);
Duration*       Duration_minVal(void);
Duration*       Duration_maxVal(void);
Duration*       Duration_now(void);
Int             Duration_nowTicks(void);
Duration*       Duration_make(Int ticks);
Duration*       Duration_fromStr_1(Str* s);
Duration*       Duration_fromStr(Str* s, Bool checked);
Duration*       Duration_boot(void);
Duration*       Duration_uptime(void);
Int             Duration_ticks(Duration* self);
Duration*       Duration_negate(Duration* self);
Duration*       Duration_mult(Duration* self, Float b);
Duration*       Duration_div(Duration* self, Float b);
Duration*       Duration_plus(Duration* self, Duration* b);
Duration*       Duration_minus(Duration* self, Duration* b);
Duration*       Duration_abs(Duration* self);
Duration*       Duration_floor(Duration* self, Duration* accuracy);
Int             Duration_toMillis(Duration* self);
Int             Duration_toSec(Duration* self);
Int             Duration_toMin(Duration* self);
Int             Duration_toHour(Duration* self);
Int             Duration_toDay(Duration* self);
Str*            Duration_toLocale(Duration* self);
Str*            Duration_toCode(Duration* self);
Str*            Duration_toIso(Duration* self);
Duration*       Duration_fromIso_1(Str* s);
Duration*       Duration_fromIso(Str* s, Bool checked);


/* [sys::Duration] Type-system functions */
Type*           Duration_initType(void);
VTable*         Duration_initVTable(void);
void            Duration_initStatic(void);


#endif
